package com.fm.magic.net.chrome;

import java.io.IOException;
import java.net.ConnectException;
import java.net.Socket;

/**
 * @author leo.li
 */
public class PortUtil {
    public static boolean isListen(String host, int port) {
        try {
            if (new Socket(host, port).isConnected()) {
                return true;
            }
        } catch (ConnectException ignore) {
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return false;
    }
}
